package com.lxy.u4day0501.controller;

import com.lxy.u4day0501.entity.User;
import com.lxy.u4day0501.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class TestController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getUser")
    public List<User> getUser(){
        return userService.list(null);
    }

    @RequestMapping("/limit")
    public Map<String,Object> getUserByLimit(){
        return userService.findByLimit(2,2);
    }
}
